﻿using Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DAL
{
    public class RoomHaoDAL
    {
        public RoomHaoDAL(MyContext myContext)
        {
            MyContext = myContext;
        }

        public MyContext MyContext { get; }
        /// <summary>
        /// 添加
        /// </summary>
        /// <param name="roomType"></param>
        /// <returns></returns>
        public int Add(RoomHao roomHao)
        {
            try
            {
                MyContext.roomHaos.Add(roomHao);
                return MyContext.SaveChanges();
            }
            catch (Exception)
            {

                throw;
            }
        }
        /// <summary>
        /// 显示
        /// </summary>
        /// <returns></returns>
        public List<RoomHao> GetShow()
        {
            try
            {
                return MyContext.roomHaos.ToList();
            }
            catch (Exception)
            {

                throw;
            }
        }
    }
}
